<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#" data-toggle="tab">阿里大于短信配置</a></li>
		</ul>
		<form class="form-horizontal js-ajax-form" action="{:U('setting/site_post')}" method="post">
			<fieldset>
				<div class="tabbable">
					<div class="tab-content">

						<div class="tab-pane active">
							<div class="control-group" id="video" style="background:#f5f5f5;height:40px;line-height40px;">
								<label class="control-label">是否开启短信验证码</label>
								<label class="control-label">
									<input type="radio" name="radio3"  value="1" {$mobileverify1} >&nbsp&nbsp&nbsp&nbsp
									是
								</label>
								<label class="control-label">
									<input type="radio" name="radio3"  value="0" {$mobileverify0} >&nbsp&nbsp&nbsp&nbsp
									否
								</label>
							</div>
							<div id="qcloudlive" >
								<div class="control-group">
									<label class="control-label">App_Key</label>
									<div class="controls">
										<input type="text" style="width:300px" name="options[alidayu_app_key]" value="{$alidayu['alidayu_app_key']}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">App_Secret</label>
									<div class="controls">
										<input type="text" style="width:300px" name="options[alidayu_app_secret]" value="{$alidayu['alidayu_app_secret']}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">签名</label>
									<div class="controls">
										<input type="text" style="width:300px" name="options[smsFreeSignName]" value="{$alidayu['smsFreeSignName']}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">模板ID</label>
									<div class="controls">
										<input type="text" style="width:300px" name="options[smsTemplateCode]" value="{$alidayu['smsTemplateCode']}">
									</div>
								</div>
							</div>

						</div>

					</div>
				</div>

				<div class="form-actions">
					<button type="submit" class="btn btn-primary  js-ajax-submit">保存</button>
				</div>
			</fieldset>
		</form>

	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script>
		/////---------------------
		$(function(){
			$("#urlmode-select").change(function(){
				if($(this).val()==1){
					alert("更改后，若发现前台链接不能正常访问，可能是您的服务器不支持PATHINFO，请先修改data/conf/config.php文件的URL_MODEL为0保证网站正常运行,在配置服务器PATHINFO功能后再更新为PATHINFO模式！");
				}
				
				if($(this).val()==2){
					alert("更改后，若发现前台链接不能正常访问，可能是您的服务器不支持REWRITE，请先修改data/conf/config.php文件的URL_MODEL为0保证网站正常运行，在开启服务器REWRITE功能后再更新为REWRITE模式！");
				}
			});
			$("#js-site-admin-url-password").change(function(){
				$(this).data("changed",true);
			});
		});
		Wind.use('validate', 'ajaxForm', 'artDialog', function() {
			//javascript
			var form = $('form.js-ajax-forms');
			//ie处理placeholder提交问题
			if ($.browser.msie) {
				form.find('[placeholder]').each(function() {
					var input = $(this);
					if (input.val() == input.attr('placeholder')) {
						input.val('');
					}
				});
			}
			//表单验证开始
			form.validate({
				//是否在获取焦点时验证
				onfocusout : false,
				//是否在敲击键盘时验证
				onkeyup : false,
				//当鼠标掉级时验证
				onclick : false,
				//验证错误
				showErrors : function(errorMap, errorArr) {
					//errorMap {'name':'错误信息'}
					//errorArr [{'message':'错误信息',element:({})}]
					try {
						$(errorArr[0].element).focus();
						art.dialog({
							id : 'error',
							icon : 'error',
							lock : true,
							fixed : true,
							background : "#CCCCCC",
							opacity : 0,
							content : errorArr[0].message,
							cancelVal : "{:L('OK')}",
							cancel : function() {
								$(errorArr[0].element).focus();
							}
						});
					} catch (err) {
					}
				},
				//验证规则
				rules : {
					'options[site_name]' : {
						required : 1
					},
					'options[site_host]' : {
						required : 1
					},
					'options[site_root]' : {
						required : 1
					}
				},
				//验证未通过提示消息
				messages : {
					'options[site_name]' : {
						required : "{:L('WEBSITE_SITE_NAME_REQUIRED_MESSAGE')}"
					},
					'options[site_host]' : {
						required : "{:L('WEBSITE_SITE_HOST_REQUIRED_MESSAGE')}"
					}
				},
				//给未通过验证的元素加效果,闪烁等
				highlight : false,
				//是否在获取焦点时验证
				onfocusout : false,
				//验证通过，提交表单
				submitHandler : function(forms) {
					$(forms).ajaxSubmit({
						url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
						dataType : 'json',
						beforeSubmit : function(arr, $form, options) {

						},
						success : function(data, statusText, xhr, $form) {
							if (data.status) {
								setCookie("refersh_time", 1);
								var admin_url_changed=$("#js-site-admin-url-password").data("changed");
								var message =admin_url_changed?data.info+'<br><span style="color:red;">后台地址已更新(请劳记！)</span>':data.info;
								
								//添加成功
								Wind.use("artDialog", function() {
									art.dialog({
										id : "succeed",
										icon : "succeed",
										fixed : true,
										lock : true,
										background : "#CCCCCC",
										opacity : 0,
										content : message,
										button : [ {
											name : "{:L('OK')}",
											callback : function() {
												reloadPage(window);
												return true;
											},
											focus : true
										}, {
											name : "{:L('CLOSE')}",
											callback : function() {
												reloadPage(window);
												return true;
											}
										} ]
									});
								});
							} else {
								alert(data.info);
							}
						}
					});
				}
			});
		});
		////-------------------------
	</script>
	<script>
	function radioSwitch(){
		var val = $('#video input[name="radio1"]:checked ').val();
		if(val=='qcloud'){
			document.getElementById("wsview").style.display="none";
            document.getElementById("qcloud").style.display="";  
		}
		if(val=='wsview'){
			document.getElementById("wsview").style.display="";
            document.getElementById("qcloud").style.display="none";	
		}
	}
	function radioSwitch2(){
		var val = $('#video input[name="radio"]:checked ').val();
		if(val=='qcloudlive'){
			document.getElementById("wsviewlive").style.display="none";
            document.getElementById("qcloudlive").style.display="";  
		}
		if(val=='wsviewlive'){
			document.getElementById("wsviewlive").style.display="";
            document.getElementById("qcloudlive").style.display="none";	
		}
	}
</script>  
</body>
</html>